Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next

Error trap

You might want to add error trapping in the code. Here is an example

Sub Initialize
'The following line says to jump to the label called ErrorHandler if there is an error.
On Error Goto ErrorHandler

Dim s As New NotesSession
Dim thisAgent As NotesAgent

'This is used to obtain the name of the agent currently running.
Set thisAgent = s.CurrentAgent

'Your code goes here

'The Done label is there so you can reference it in your ErrorHandler.
'The Exit Sub jumps past the ErrorHanlder if the code above successfully completes.
Done:
Exit Sub
ErrorHandler:
'The Select statement enables you to handle test for different errors. For example,
'when Err is 53, it indicates "File not found." With some errors, you might choose to
'skip to the next line of code, rather than exiting the entire subroutine.
'For more details, open the "On Error statement" in the Designer help database Index.
Select Case Err
Case Else
'The next line will document an error, and will include the error number, the agent name,
'the line throwing the error, and the error description.
'The agent name is helpful if this is a web triggered or scheduled agent.
Msgbox "Error " & Cstr(Err) & " in " & thisAgent.Name & " on line " & Cstr(Erl) & ": " & Error
Resume Done
End Select
End Sub


Feedback response number WEBBAU74BU created by ~Sean Eljumigon on 12/19/2017

Persnickety LotusScript Error (~Phil Refanaski... 18.Dec.17)
. . no problem. (~Sigmund Umwema... 18.Dec.17)
. . You want to test if item is empty (~Fritz Ekfoober... 18.Dec.17)
. . . . Error trap (~Sean Eljumigon... 19.Dec.17)
. . . . Empty?? (~Phil Refanaski... 20.Dec.17)
. . . . . . Inspect using debugger (~Lily Minkitexf... 20.Dec.17)
. . . . . . . . It's there alright, but not seen? (~Phil Refanaski... 21.Dec.17)
. . . . . . . . . . I wonder if it being summary protec... (~Fritz Ekfoober... 21.Dec.17)
. . . . . . . . . . . . Access Level = Manager (~Phil Refanaski... 21.Dec.17)
. . . . . . . . . . Look further at the field / item (~Lily Minkitexf... 22.Dec.17)
. . . . . . . . . . . . Check all documents (~Lorraine Nimji... 1.Feb.18)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS